home *** CD-ROM | disk | FTP | other *** search
/ Mac OS 9 Serial Number Archive / SN Archive 2023.11.04.toast / BSNG / SDK / BSNG SDK 2.6 / Libraries / UltraLibU / README FIRST!! next >
Encoding:
Text File  |  1996-02-28  |  2.8 KB  |  61 lines  |  [TEXT/ttxt]

  1. UltraLibU  --  A pseudo-random-number library for Macintosh platforms
  2.  
  3. This library is a new C/Assembly implementation of the Ultra PRNG developed by Marsaglia, et al. (see leading reference in source).  It is designed primarily for Macintosh platforms and replaces an earlier (non-PPC) library, by this author, that is currently available in a number of public archives.
  4.  
  5. UltraLibU contains one low-level assembly routine, in a conditional-compilation block, for MC68020 (and higher) or PowerPC processors.  (Note: Pure C source for this routine is already available in the usual Internet archives.)  The assembly syntax is that of Metrowerks' CodeWarrior<TM> but adaptation to other compilers should be trivial.
  6.  
  7. Requirements:
  8.  
  9. Either an MC68020 (or higher) processor or a PowerPC processor.
  10. A C compiler with an assembler for the processor used.
  11.  
  12. Public functions:
  13.  
  14. 7 functions returning various forms of uniform long/short variates
  15. 1 function  returning Boolean variates
  16. 2 functions returning (float) U(0,1) and (float) U(-1,1) variates
  17. 2 functions returning (double) U(0,1) and (double) U(-1,1) variates
  18. 1 function  returning (float) Normal(mu,sigma) variates [exact, not approximate]
  19. 1 function  returning (float) Exponential(mu) variates  [exact, not approximate]
  20.  
  21. 1 function to initialize the library
  22. 2 functions to save and restore the status of the PRNG [to reproduce a sequence exactly]
  23.  
  24. Special features:
  25.  
  26. Variates are HIGHLY RANDOM.  This PRNG uses a compound generator and produces numbers that are random even at the bit level.  Moreover, all the bits in each variate are random, not just the most sigificant bits.
  27.  
  28. Execution is VERY FAST, e.g.,
  29. Booleans  -->   0.65 and 0.23 microseconds each on a Quadra 800 and PowerMac 9500/120, resp.
  30. Normals   -->  24.0  and 2.74 microseconds each on a Quadra 800 and PowerMac 9500/120, resp.
  31. [complete timing list in source]
  32.  
  33. The (float) U(0,1) and (float) U(-1,1) variates are automatically scaled.  Their mantissas always have at least 25 bits of precision no matter how small the return values.  Neither returns zero.
  34.  
  35. The period of this compound generator exceeds 10^356.
  36.  
  37. --------------------------------------------------------------------------------------------------
  38.  
  39. This package contains the following files:
  40.  
  41. (this file)
  42. UltraLibU.c         (the library)
  43. UltraU.h            (an essential header file)
  44. UltraUTest.c        (a demonstration/test program)
  45. UltraUTest.out.org  (the expected output of the test program, with Quadra 800 timing)
  46.  
  47. --------------------------------------------------------------------------------------------------
  48.  
  49. Please direct comments and queries regarding UltraLibU to
  50.  
  51. Michael P. McLaughlin
  52. MITRE Corporation
  53. MS W337
  54. 1820 Dolley Madison Blvd.
  55. McLean, VA  22102
  56. U.S.A.
  57.  
  58. Tel.   (703) 883-7658
  59. FAX    (703) 883-1251
  60. Email  mpmcl@mitre.org
  61.